package com.cake.liulanxiangzhu.service.impl;

import com.cake.liulanxiangzhu.pojo.entity.OmsOrderItem;
import com.cake.liulanxiangzhu.pojo.dto.OmsOrderItemDTO;
import com.cake.liulanxiangzhu.pojo.dto.OmsOrderItemUpdateDTO;
import com.cake.liulanxiangzhu.pojo.vo.OmsOrderItemVO;
import com.cake.liulanxiangzhu.mapper.OmsOrderItemMapper;
import com.cake.liulanxiangzhu.service.OmsOrderItemService;
import com.cake.liulanxiangzhu.web.JsonPage;
import org.springframework.stereotype.Service;
import org.springframework.beans.factory.annotation.Autowired;
import com.github.pagehelper.PageHelper;

import java.util.Date;
import java.util.List;


/**
 * 订单商品信息表(OmsOrderItem)表服务实现类
 *
 * @author dinghao
 * @since 2023-02-23 14:55:08
 */
@Service
public class OmsOrderItemServiceImpl implements OmsOrderItemService {
    @Autowired
    private OmsOrderItemMapper omsOrderItemMapper;

    /**
     * 通过ID查询单条数据
     *
     * @param orditemId 主键
     * @return 实例对象
     */
    @Override
    public OmsOrderItemVO queryById(String orditemId) {
        return this.omsOrderItemMapper.queryById(orditemId);
    }

    /**
     * 分页查询
     *
     * @param omsOrderItem 筛选条件
     * @return 查询结果
     */
    @Override
    public JsonPage<OmsOrderItemVO> queryByPage(OmsOrderItem omsOrderItem, Integer page , Integer pageSize) {
        PageHelper.startPage(page,pageSize);
        
        return null;
    }

    /**
     * 新增数据
     *
     * @param omsOrderItemDto 实例对象
     * @return 实例对象
     */
    @Override
    public void insert(OmsOrderItemDTO omsOrderItemDto) {
        
    }

    @Override
    public void insertBatch(List<OmsOrderItem> entities) {
        for (OmsOrderItem entity : entities) {
            entity.setCreatTime(new Date());
            entity.setUpdateTime(new Date());
        }
        omsOrderItemMapper.insertBatch(entities);

    }

    /**
     * 修改数据
     *
     * @param omsOrderItemUpdateDto 实例对象
     * @return 实例对象
     */
    @Override
    public void update(OmsOrderItemUpdateDTO omsOrderItemUpdateDto) {
        
    }

    /**
     * 通过主键删除数据
     *
     * @param orditemId 主键
     * @return 是否成功
     */
    @Override
    public void deleteById(String orditemId) {
       
    }
}
